import java.util.Scanner;

public class program10 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the amount of water in kilograms: ");
        double m = in.nextDouble();
        System.out.print("Enter the initial temperature: ");
        double t1 = in.nextDouble();
        System.out.print("Enter the final temperature: ");
        double t2 = in.nextDouble();
        double q = m * (t2 - t1) * 4184;
        System.out.printf("The energy needed is %.1f%n", q);
    }
}
